﻿@{
    var eventUrl = "";
    var eventId = 952327437;
    var ticketName = "My New Ticket";
    var price = 10;
    var quantity = 100;
    
    if(IsPost)
    {
        eventId = Request["event_id"].AsInt();
        ticketName = Request["ticket_name"];
        price = Request["price"].AsInt();
        quantity = Request["quantity"].AsInt();;
                
        eventUrl = "http://www.eventbrite.com/myevent?eid=" + eventId;
        Eventbrite.CreateNewTicket(eventId, ticketName, price, quantity);  
    }    
}

<h3>Eventbrite.CreateNewTicket() Method</h3>

<pre class="codePre">@@{
    Eventbrite.CreateNewTicket(eventId, ticketName, price, quantity);
}</pre>

<p>Type your ticket information below to test the helper method:</p>
<form class="createNew" method="post" action="">
    <label for="event_id">Event ID:</label>
    <input type="text" id="event_id" name="event_id" value="@eventId" /><br/>    
    
    <label for="ticket_name">Ticket Name: </label>
    <input type="text" id="ticket_name" name="ticket_name" value="@ticketName" /><br/>    
    
    <label for="price">Price:</label>
    <input type="text" id="price" name="price" value="@price" /><br/>
    
    <label for="quantity">Quantity:</label>
    <input type="text" id="quantity" name="quantity" value="@quantity" /><br/>
    
    <input type="submit" value="Create New Ticket" />
</form>

@if (IsPost) {
    <div class="message success">
        <strong>New ticket created!</strong> You can view your new ticket on the <a href="@Href("~/GetTicketWidget")">Ticket Widget</a>.
    </div>
}
